package request

import (
	"broker/interface/iserver"
	"broker/struct/model"
)

/*连接+数据*/

type Request struct {
	//已经和客户顿建立好的连接
	Conn iserver.IConnection
	//客户端请求的数据
	Msg model.BaseMessage
}

func (r *Request) GetConnection() iserver.IConnection {
	return r.Conn
}

func (r *Request) GetData() []byte {
	return r.Msg.GetData().([]byte)
}

func (r *Request) GetMsgID() byte {
	r.Msg.GetReserved()
	return r.Msg.GetMsgId()
}
func (r *Request) GetReserved() byte {
	return r.Msg.GetReserved()
}
